package com.cf.game.group.model;

import com.cf.crud.entity.BaseEntity;
import com.cf.game.group.EnumRelationType;

import javax.persistence.*;
import java.util.Date;

/**
 * boot-awm-Relation
 * 好友关系
 *
 * @author <a href="2428922347@qq.com">Zhu mingming</a>
 * @info
 * @since 2018/6/28 上午 10:24
 */
@Entity
@Table(name = "relation",
        uniqueConstraints = {
                @UniqueConstraint(columnNames = {"self", "friend"})
        }
)
public class Relation extends BaseEntity {

    private long self;

    private long friend;

    @Column(name = "friendName")
    private String friendName;

    @Column(name = "friendHead")
    private String friendHead;

    @Column(name = "addTime")
    @Temporal(TemporalType.TIMESTAMP)
    private Date addTime = new Date();

    @Column(name = "relationType")
    private String relationType = EnumRelationType.common.getType();

    public String getRelationType() {
        return relationType;
    }

    public void setRelationType(String relationType) {
        this.relationType = relationType;
    }

    public String getFriendHead() {
        return friendHead;
    }

    public void setFriendHead(String friendHead) {
        this.friendHead = friendHead;
    }

    public String getFriendName() {
        return friendName;
    }

    public void setFriendName(String friendName) {
        this.friendName = friendName;
    }

    public long getSelf() {
        return self;
    }

    public void setSelf(long self) {
        this.self = self;
    }

    public long getFriend() {
        return friend;
    }

    public void setFriend(long friend) {
        this.friend = friend;
    }

    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }
}
